//
//  KnowledgeNewsView.m
//  DeDao
//
//  Created by PEIYANG on 16/9/24.
//  Copyright © 2016年 YP. All rights reserved.
//

#import "KnowledgeNewsView.h"
@interface KnowledgeNewsView ()
@property (weak, nonatomic) IBOutlet UIButton *checkAllBtn;

@end
@implementation KnowledgeNewsView
- (IBAction)playBtn:(id)sender {
}
- (IBAction)checkAll:(id)sender {
    
    NSLog(@"右边checkAll按钮点击%@",NSStringFromCGRect(_checkAllBtn.frame));
}

+ (instancetype)knowledgeNewView{
    return[[[NSBundle mainBundle]loadNibNamed:@"KnowledgeNewsView" owner:nil options:nil] lastObject];
}

- (void)awakeFromNib{
    [super awakeFromNib];
    
    self.autoresizingMask = UIViewAutoresizingNone;
     [_checkAllBtn setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
}

- (void)layoutSubviews{
    [super layoutSubviews];
#warning  按钮内部的图片和文字位置不对
    _checkAllBtn.imageView.yp_x = _checkAllBtn.yp_right;
    
    [_checkAllBtn.titleLabel sizeToFit];
    _checkAllBtn.titleLabel.backgroundColor = [UIColor whiteColor];
    _checkAllBtn.titleLabel.yp_right = _checkAllBtn.imageView.yp_x;
    _checkAllBtn.yp_y = 10;
}

@end
